//
//  KARepayMethodSectionHeader.swift
//  kano
//
//  Created by Frank on 2024/9/19.
//

import UIKit

class KARepayMethodSectionHeader: UIView {

    lazy var titleLabel: UILabel = {
        let label = UILabel()
        label.numberOfLines = 1
        label.font = UIFont.systemFont(ofSize: kscale(14), weight: .medium)
        label.textColor = .color323135
        label.text = "Payment method"
        label.frame = CGRectMake(0, 0, width, kscale(18))
        return label
    }()
    
    lazy var var_cornerView: UIView = {
        let var_cornerView = UIView(frame: CGRectMake(0, titleLabel.bottom + kscale(8), width, kscale(44)))
        var_cornerView.backgroundColor = .white
        return var_cornerView
    }()

    lazy var payTitle: UILabel = {
        let label = UILabel()
        label.numberOfLines = 1
        label.font = UIFont.systemFont(ofSize: kscale(14), weight: .medium)
        label.textColor = .color323135
        label.text = "Pay with bank transfer"
        label.frame = CGRectMake(kscale(12), kscale(14), width, kscale(18))
        return label
    }()
    
    lazy var selectBtn: UIButton = {
        let button = UIButton()
        button.setImage(UIImage(named: "repay_way"), for: .normal)
        button.setImage(UIImage(named: "repay_way"), for: .selected)
        button.frame = CGRectMake(width-kscale(28), kscale(14), kscale(16), kscale(16))
        return button
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        backgroundColor = .colorf2f2f5
  
        addSubview(titleLabel)
        addSubview(var_cornerView)
        var_cornerView.ka_addTopCorner(withRadius: kscale(16))
        var_cornerView.addSubview(payTitle)
        var_cornerView.addSubview(selectBtn)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}
